import types

class Listener(object):
    
    def __init__(self, handler_func, handler_method_name='handle'):
        self.__dict__[handler_method_name] = types.MethodType(handler_func, self)